﻿using System;
using System.Collections.Generic;
using UrimTumim.Timesheet.Services.DataContracts;
using UrimTumim.Timesheet.Services.ServiceContracts;
using System.Data.SqlClient;
using System.Configuration;

namespace UrimTumim.Timesheet.Services
{
    public class TimesheetService : ITimesheetService
    {
        private string _userName = null;

        /// <summary>
        /// Authenticates an user.
        /// </summary>
        /// <param name="userName">User name that uniquely identifies a Timesheet User.</param>
        /// <param name="password">Password used to authenticate the user.</param>
        public void LogOn(string userName, string password)
        {
            _userName = userName;
        }

        /// <summary>
        /// Terminates an user's session.
        /// </summary>
        public void LogOff()
        {
            _userName = null;
        }

        /// <summary>
        /// Adds a Timesheet Entry for a given User for a given timesheet namespace.
        /// </summary>
        /// <param name="task">Task being annotated.</param>
        /// <param name="start">Start time of Timesheet Entry.</param>
        /// <param name="finish">Finish time of Timesheet Entry.</param>
        /// <param name="breakInterval">Interval of time to be discounted from Timesheet Entry.</param>
        /// <param name="comment">Comment about Timesheet Entry.</param>
        public void AddNew(TaskData task, DateTime start, DateTime finish, TimeSpan breakInterval, string comment)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Starts a Timesheet with given Task.
        /// </summary>
        /// <param name="task">Task being annotated.</param>
        /// <param name="comment">Comment about Timesheet Entry.</param>
        public void StartTimesheet(TaskData task, string comment)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Stops a running Timesheet.
        /// </summary>
        /// <param name="comment">Comment about Timesheet Entry.</param>
        public void StopTimesheet(string comment)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Restarts a paused Timesheet.
        /// </summary>
        /// <param name="comment">Comment about Timesheet Entry.</param>
        public void RestartTimesheet(string comment)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Pauses a running Timesheet. 
        /// </summary>
        /// <param name="comment">Comment about Timesheet Entry.</param>
        public void PauseTimesheet(string comment)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets all Timesheet Entries of the current user between the given interval dates.
        /// </summary>
        /// <param name="start">Interval start date.</param>
        /// <param name="finish">Interval end date.</param>
        /// <returns>Returns a list of Timesheet Entries between the interval dates.</returns>
        public IList<TimesheetData> GetTimesheetEntries(DateTime start, DateTime finish)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Gets all Timesheet Entries of the current user for the specified Task.
        /// </summary>
        /// <param name="task">Task Identifier that uniquely identifies a Task.</param>
        /// <returns>Returns a list of Timesheet Entries for the Task.</returns>
        public IList<TimesheetData> GetTimesheetEntries(TaskData task)
        {
            throw new NotImplementedException();
        }
    }
}
